// Vuex module
export default {
    // Vuex 全局状态
    state: {
        name: "",
        sex: ""
    },
    mutations: {
        SET_NAME: (state, name) => {
            state.name = name;
        },
        SET_SEX: (state, sex) => {
            state.sex = sex;
        },
        SET_USER: (state, user) => {
            for (const key in state) {
                state[key] = user[key];
            }
        }
    }
};
